<?php

// +----------------------------------------------------------------------
// |ZBPHP[基于ThinkPHP5.1开发]
// +----------------------------------------------------------------------
// | Copyright (c) 2016-2019 http://www.benbenwangluo.com
// +----------------------------------------------------------------------
// | Author 似水星辰 [ 2630481389@qq.com ]
// +----------------------------------------------------------------------
// | 中犇软件 技术六部 出品
// +----------------------------------------------------------------------
namespace app\admin\admin;


/**
 * 地图选点组件
 * @author 晓风<215628355@qq.com>
 * @date 2021-7-7 17:29:51
 */
class Map extends \app\common\controller\Common {

  
    public function map(){
         return $this->fetch("admin@map/map");
    }
    public function address($pid = 0 ,$level = 1){
        if(($pid == 103631 && $level == 2) || ($pid == 103650 && $level == 2) || $pid == 103630){
            $address = \think\Db::name("china_area")->where("id",$pid)->field("id,name,lng,lat")->select(); 
        }else{
            $address = \think\Db::name("china_area")->where("pid",$pid)->field("id,name,lng,lat")->select();
        }
        if($this->request->isAjax()){           
            $this->result($address,1,"","json");
        }
     
        $this->assign("address",$address);
         return $this->fetch("admin@map/address");
    }
}
